home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Magnum One
/
Magnum One (Mid-American Digital) (Disc Manufacturing).iso
/
d6
/
procalc_.arc
/
PROCALC.DOC
< prev
next >
Wrap
Text File
|
1988-05-08
|
22KB
|
531 lines
P r o C A L C
Designed and written by
Robert D. Miller and William A. Osterhagen
September, 1987
Introduction
Welcome to ProCALC! More than just a handy tool for
arithmetic calculations, ProCALC solves a wide variety of
algebraic, trigonometric and technical problems using arithmetic
operations and more than fifty pre-defined functions. In
addition, ProCALC permits user-defined formulas and named
variables which may be saved to disk and later reused.
Technical users will appreciate the precision and wide range
of floating point numbers: all calculations are done in 80-bit
floating point whether the numeric processor (8087, 287 or 387)
chip is installed or not. Functions are accurate to very near
the arithmetic limits.
Programmers will find ProCALC especially useful
since it will do exact arithmetic on long (32-bit)
integers, has a full set of logical operators, and does
bit manipulation. Additional number bases of two, eight,
and sixteen may be used in calculations. For financial work
and planning, a set of calendar functions are an integral
part of ProCALC.
To use ProCALC:
For monochrome, enter PROCALC or PROCALC <filename>
For color, enter PROCALC /C or PROCALC <filename>/C
where <filename> loads a file, created from some previous
ProCALC session, containing user-defined variables and/or
formulas. If your computer is in color mode, ProCalc will
begin using color. Some computers (such as the AT&T 6300)
having a green or amber screen look better if forced into
a monochrome mode. ProCalc will run in a monochrome mode
by typing: PROCALC /M.
If you have a numeric coprocessor chip installed, this
program will automatically use it. Otherwise, ProCALC will
emulate the 8087 chip.
ProCALC greets you with its calculator screen -- you're
ready to start calculating. For example, key in 1 + 2 + 3 and
press <ENTER> to obtain the result of 6. We'll talk about details
later, but for now observe the screen layout. The ProCALC
screen is divided into four separate areas:
1) the uppermost FORMULA edit area,
2) the middle CALCULATE edit area,
3) the lower RESULT or message area,
4) the bottom FUNCTION key descriptions.
The bottom two lines of the screen define the function keys as:
F1: CALC
Clears calculate edit area and enters calculate edit mode
for entering and/or editing a new calculator problem.
F2: ReCALC
Recalls the last calculator problem entered for editing
and/or re-calculation.
F3: VARIABLES
Displays user-defined variables and their values.
F4: FORMULAS
Displays user-defined formulas and their names.
F5: GetFormula
Used to make, recall, delete, or change a formula.
F6: UseFormula
Executes the current formula from the FORMULA area.
F7: Degrees/Radians
Specifies how trigonometric angles are entered
and displayed.
F8: Scientific/Floating Point result
Toggles between scientific notation and floating
point display. Shift F8 in floating point mode
increments the number of digits displayed in the
fraction by 2 each time it is pressed.
F9: RESULT
Specifies how results are displayed:
Dec (decimal)
# Bin (binary)
& Oct (octal)
$ Hex (hexadecimal)
# ExR (Extended precision Real), binary 80-bit
representation used by the numeric processor chip.
Full software emulation is provided if the ship
is not installed.
DMS (degrees or hours, minutes, seconds).
F10: HELP
Displays list of operators, constants, and functions.
At any time while the calculator screen is displayed, you may
press the FUNCTION keys <F3: VARIABLES>, <F4: FORMULAS> or <F10:
HELP>. Doing so interrupts your current work and displays the
appropriate data on a blank screen. If multiple screens of
information are available, they are displayed by continuing to
press the same function key. Pressing the function key after
observing the last page returns to the calculator screen.
Pressing <ESC> immediately returns you to the calculator
screen -- exactly where you were when you originally pressed the
function key.
You can tell which part of the screen you're using by the
highlighted area name. If none are highlighted, the bottom of the
screen informs you how to load or save user-defined variables
and/or formulas to or from disk. More about this later.
CALCULATE
You begin a calculator problem by pressing <F1: CALC> or by
starting to key in the problem. <F2: ReCalc> displays the last
problem you entered and allows you to edit and/or re-calculate
it. When you're done editing, press <ENTER> and the answer is
displayed in the RESULT area. The solution is displayed in the
base specified by <F9: RESULT>. You have three lines (of 74
characters per line) to work with in the CALCULATE edit area.
Edit keys include:
<ARROW> ..... Moves the cursor up, down, left, or right.
<DELETE>..... Deletes the character under the cursor.
<INSERT>..... Inserts a space at the cursor position.
<BACK SPACE>. Deletes the character preceding the cursor.
<HOME>....... Moves the cursor to leftmost position of the
current line.
<END>........ Moves the cursor to the rightmost position
of the current line.
<CTRL END>... Clears from the cursor to the end of the line.
<CTRL DELETE> Deletes the line (on most systems).
<CTRL INSERT> Inserts a blank line (on most systems).
<ESC>........ Exits edit mode with no calculation.
<ENTER>...... Displays calculated results in the result area.
USER VARIABLES:
Calculated results can be saved as user-defined variables
(use <F3: VARIABLES> for the current user-variable list) and
variables may be used in subsequent calculations. A user variable
must begin with a letter and cannot exceed 12 letters and/or
digits in length. Variable names may not be pre-defined operator,
function, constant, or formula names. The results of the current
calculation may be saved in a user-defined variable by starting
the problem with the user variable name and an equal sign (=).
The last calculated result is saved in a user-defined variable by
entering the variable name followed by equals (=).
For example:
MYVAR = 1 + 2 + 3 <ENTER> . . . displays result of 6
saved in MYVAR.
Or another way:
1 + 2 + 3 <ENTER> . . . . . . . gives a result of 6.
MYVAR = . . . . . . . . . . . . assigns the previous result
(6) in MYVAR.
The user-defined variable MYVAR may now be used in other
calculator problems. For example, after trying one of the above
examples:
9 * MYVAR <ENTER> . . . . . . . returns a result of
54, or 9 * 6.
A user-defined variable is deleted from the user-variable
list by entering the user-defined variable followed by a minus
(-). A complete list of user-defined variables may be displayed
at any time by pressing the <F3: VARIABLES> function key.
USER FORMULAS:
Formulas are defined using operators, functions, constants,
and/or user variables. A formula must be defined before it is
used. As with variable names, a formula name may not be that of a
predefined operator, function, constant or user-defined variable.
You define a formula by pressing <F5: GetFormula> and typing
the formula name. Then press <ENTER> and key the formula just as
though you were entering a calculator problem. Once you've edited
the formula, press <ENTER> to save the definition in the formula
list. You can press <F4: FORMULAS> at any time to see your
formula list.
If you press <ESC> while entering either a formula name or a
formula, the formula name returns to < n o n e >, the formula
edit area remains intact, and you exit the formula area. If the
formula name you enter is already present in the formula list,
that formula is displayed for editing. If a formula name is all
spaces and you press <ENTER>, a formula name of < n o n e > is
displayed, the formula edit area is cleared, and you exit the
formula area.
You execute a formula in one of the following three ways:
1) The formula displayed in the FORMULA area is executed by
pressing the <F6: UseFormula> function key. Note: if a
formula is not present in the FORMULA area, the formula's
name is < n o n e >;
2) By entering in the CALCULATE area the name of an existing
formula and pressing <ENTER>;
3) By entering a variable, followed by an equals sign (=),
followed by a formula name and pressing <ENTER>. The
result of the formula calculation is then displayed and
saved in that variable.
A formula is executed much the same as if it were a normal
calculator problem. If a variable appearing in your formula is
not defined (i.e., not in the user-variable list), then the
CALCULATE area is highlighted and you are asked to key in the
variable's value. You can type in numerical value, or even an
arithmetic expression -- except that you may not use another
formula name or assign the result to a variable with an equal (=)
sign. This step is repeated for each undefined variable in the
formula being executed.
Here, as an example, is the formula for calculating the
length of the hypotenuse of a right triangle (using the
Pythagorean theorem). To request the triangle's two sides at the
time of execution, you could use ProCALC as described below.
1) Press <F5: GetFormula>;
2) Key in a name (ex: Pyth) and press <ENTER>;
3) Key in the formula:
SQRT ( OneSide ^ 2 + OtherSide ^ 2 ) <ENTER>;
4) Press <F6: UseFormula>;
5) When `CALCULATE: OneSide' is highlighted,
key 300 <ENTER>;
6) When `CALCULATE: OtherSide' is highlighted,
key 400 <ENTER>;
7) The RESULT 500 is displayed.
In the above example, instead of keying in the number 300
for OneSide, you could have typed in any complex expression.
Also, if `OneSide' or `OtherSide' had already been assigned a
value (i.e., if either were a previously defined user variables),
then ProCALC would have used that value instead of asking
for it.
You may modify and save an existing formula under a new name.
First, call the formula with <F5: GetFormula>. Edit it, press
<ESCAPE>, and press <F5: Getformula> again. Enter the new name
and hit <ENTER> -- then press <ENTER> again to save the edited
formula into the user formula list. To delete a formula from the
formula list, simply press <F5: GetFormula> and type the name of
the formula to be deleted followed by minus sign (-).
NUMBERS:
Numbers may be entered as you ordinarily would with any
calculator. Integers are numbers with no decimal fraction and
they may range from -2147483648 to 2147483647. ProCALC will
do exact operations on integers. The integer operators
DIV and MOD will do exact division and remainders. For example:
22 DIV 7 gives a result of 3, since the fraction is dropped.
Entering: 22 MOD 7, returns the remainder, 1, since 22 divided
by 7 is 3, remainder 1. The logical operators (AND, OR, XOR,
NOT, IMP and EQV) and the shift operators (ASHIFT, SHIFT, ROTATE)
do bit-by-bit operations on integers.
Floating point or real numbers may be entered with a
decimal point. Scientific notation may be used, where the
'E' (or 'e') following the number means "times ten to the power".
One thousand may be entered as: 1000.0, or 1.0E3. ProCALC's
floating point numbers have a very large dynamic range
(the difference between the largest and smallest numbers).
The largest number is roughly 1.18973e4932. The smallest non-
zero number is about 1.0e-4931. Since the constants pi (3.14...),
halfpi, and twopi are used frequently, you only have to
remember to type in those names; ProCalc knows their values
to the full precision of the computer.
For computer programmers, particularly, integers may be
entered in three other commonly used bases: 2 (binary),
8 (octal) and 16 (hexadecimal). Prefixing a number with
# interprets the number as binary (and accepts only the digits
0 and 1). Beginning a number with & means it's octal
(using digits 0 through 7) and using $ treats the number
as hexadecimal, permitting digits 0 through 9 as well
as A through F (for the hex digits 10 through 15).
For example, entering #1001 (binary) is equivalent to
the decimal number 9. The octal number &207 is 135 in
base ten. Very large binary, octal or hexadecimal numbers
(outside the range plus or minus two billion) are permitted
in ProCALC, although the logical and shift operators
shouldn't be used with them, since they are processed as
floating point numbers. Just make the leading digit a 0.
For example $0FFFFCAF900 is the decimal number 1099508152576.
DISPLAY RESULTS:
The default mode for results is scientific notation. For example:
0.00234 is displayed as 2.34000000e-3. You can use the <F8> key to
toggle to the floating point display mode. An indicator shown by
the <F8> selection at the bottom of the ProCALC screen shows "Sci"
for the scientific notation and an "Fpt" for floating point.
Notice when the "Fpt" is selected, a number following that indicator
tells how many digits past the decimal point will be printed.
The displayed number is correctly rounded to that precision.
The number of fraction digits displayed may be increased by 2
each time the <SHIFT F8> is pressed. After reaching a maximum of
14 digits, the <SHIFT F8> will recycle.
Occasionally, the results may not fit the selected option.
In such situations, the number is displayed "the best way".
Integers will always be shown with no decimal point.
ProCALC works with an incredibly large range of numbers.
It is possible for some results to exceed this range. Numbers
larger than 1.0e4932 are regarded and displayed as "infinity".
Extremely small numbers may result as "unnormal" or "denormal".
These may be safely regarded as zero. Some complex operations
or error conditions may result in a number that can not be
expressed, in which case "NAN" (not a number) is displayed.
ProCALC tries very hard to catch error conditions and gracefully
recover from these somewhat peculiar situations; it actually
does much better than many mathematical computer programming
languages!
Several other display options may be selected with the
<F9> key. Integer results may be chosen to be shown in binary,
octal or hexadecimal. Pressing <F9> repeatedly cycles through
the list of options; while <SHIFT F9> returns to decimal display.
For those of you who need to know what the numeric processor is
doing, an ExR (Extended Real) display option is included.
The DMS option prints output in degrees, minutes and
seconds; when using DMS, be sure to remember to select Degrees
mode with <F7>. The DMS display mode is very handy when working
with calculations involving time.
A note on the Extended Real display format: the ExR selection
displays a number as it is in the numeric processor You aren't
required to have one to use this option. A complete description of
this format is in the Intel reference manuals for the 8086 and
later processors. Briefly, the number is displayed in five 16-bit
groups. the first group is the exponent (biased by 16383 or hex 3FFF).
The first bit is the sign. This format uses a signed magnitude
representation, so negative numbers are just like positive ones,
only having the first bit set to 1. Try entering PI and -PI and
observe the difference. The remaining four groups are the 64 bits
of the mantissa. The binary point is taken to be after the first
mantissa bit (which for normalized numbers is a 1). Displaying PI
in this mode you get:
01000000 00000000 11001001 00001111 11011010 10100010
00100001 01101000 11000010 00110101
The first group contains the exponent. The first bit is zero,
so the number is positive. The exponent is biased by hex 3FFF or
16383, so to get the true exponent, subtract the bias. Ok,
#0100000000000000 - #0011111111111111 is 1. The first sixteen bits
of the fraction are 1100100100001111. Remembering the binary point
comes after the high order bit, so the first part of the mantissa
is really 1.10010000001111 which is about decimal 1.57077.
Since the binary exponent is 1, the number is the mantissa
multiplied by 2^1 or 2. The first sixteen bits of the fraction
multiplied by one power of 2 give 1.57077 * 2 = 3.14154, not
a bad approximation to pi. The remaining bits just provide
additional precision.
PRINTING:
ProCALC can print the results of a calculation on your printer.
After doing a calculation, pressing <Alt> and P simultaneously
will print the lines of the calculate edit entry area and the results.
An <Alt> F will print the displayed formula. This option may not
work on a few of the "near compatibles", such as the Tandy 1000.
Of course, the shift print screen will print any page entirely
and may be useful for making a printed list of variables and
formulas displayed with the <F3> and <F4> keys.
LOADING and SAVING:
ProCALC lets you save your variables and formulas to disk.
After completing a calculation, a message displayed at the bottom
of the screen reminds you how to save and load user files.
Variables and formulas are SAVED to disk by pressing `S' while
holding down the <ALT> key. You'll be prompted to enter the
filename. When saving user variables and/or formulas to disk,
all user-defined variables and formulas are copied to disk in a
single file. The disk files containing formulas and variables
may be shared with other ProCalc users.
Variables and formulas are LOADED in from disk by pressing
`L' while holding down the <ALT> key. You will be prompted for
the name of the file to be loaded. When loading a file of user
variables and formulas in from disk, any variables and formulas
already in memory are not disturbed. When duplicate names are
found, however, the variables and/or formulas loaded in from disk
replace those in memory.
PLEASE:
ProCALC is a unique and powerful time-saving tool which will
serve a wide variety of users. A great deal of effort and care
has gone into its preparation. It is our desire to make ProCALC
available to the greatest possible number of users, we are
distributing it as "shareware". We ask that you please register
each copy of ProCALC for a reasonable fee of $20. We believe that
ProCALC is worth far more than this. A registration/order form
is on the next page.
ProCALC is distributed on a program disk as PROCALC.EXE with
this user's guide on the file PROCALC.DOC, to copy to your printer.
To register your copy, please complete the registration form
(or send your name, address and computer model) along with $20
for each copy to:
Robert Miller
1837 Burrwood Circle
East Lansing
Michigan 48823.
A new disk and manual may be ordered for $30. When ordering,
please specify standard floppy or the 3 1/2-inch format.
We would like to know your future needs. If a future version
of this product were to be provided, what features would you use
the most? Would you like to see graphics incorporated, complex
numbers and functions, vectors, matrices or extended precison
arithmetic. If you have particularly interesting or novel
applications, we would like to hear from you too.
DISCLAIMER:
The authors have made every effort to make ProCALC the best
product possible. However, as we have no control over its use,
we must state this disclaimer: The authors claim no responsibility
for loss or damages resulting, either directly or indirectly
from the use of this program.
Should you find any aspect of this product undesirable, please
let us know. If there is a problem, we will make every reasonable
effort to correct it and send you a correction.
ACKNOWLEDGEMENTS:
A number of friends and colleagues have provided encouragement
and they have provided numerous suggestions along the way. To
those people, we extend a sincere word of thanks. A special thanks
to Tom Pennello of MetaWare, Inc. for providing assistance with
their outstanding Professional Pascal compiler used for this product.
ProCALC ORDER/REGISTRATION FORM
Please check one of the following items and complete the questions
below and return. The success of this product depends upon your use
and support. Thank you.
____ Please register my copy of ProCalc, which I have already
purchased.
____ Please register (_____) copies of ProCalc. The cost of
$ 20 per copy is enclosed.
____ Please send (_____) ProCalc diskettes along with a
ProCalc User's Guide. Enclosed is $ 30 per copy.
Note: Check here for (____) 3 1/2-inch diskette
Register in the name (or ship to):
Your name:
Address:
City:
State: Zip:
Your computer make/model:
Do you use a numeric coprocessor (8087, 80287 or 80387 chip)?
Comments:
Please send to: Robert Miller
1837 Burrwood Circle
East Lansing
Michigan USA 48823